#!/usr/bin/env python

import os, shutil, glob
import time

path = '/mnt/quizor/submit/'

date = time.strftime("%b-%d::%H:%M" , time.localtime())
name = os.getlogin()
lpath = os.getcwd().rsplit('/',2)

path += name + '/' + lpath[-2] + '/' + lpath[-1] + '/' + name + '_' + date

try:
    os.makedirs(path)
except OSError as e:
    z = e
    print z

files = glob.glob("*.h")
for f in files:
    shutil.copyfile(f, path+'/'+f)
files = glob.glob("*.cpp")
for f in files:
    shutil.copyfile(f, path+'/'+f)

print "Lab Submitted"

